#include <stdio.h>

void main() {
	FILE * arq = NULL, * arq2 = NULL;
	char c = 'a', c1;
	int x = 12, p = 10;
	float y = 13.2;

	arq = fopen("arq.txt","w+");
	arq2 = fopen("out.txt","w+");

	fprintf(arq,"%c %d %f\n", c, x, y);
	c = 'b'; x = 22; y = 22.3;
	fprintf(arq,"%c %d %f", c, x, y);
    rewind(arq);
	
	fscanf(arq,"%c %d %f\n", &c, &x, &y);
	fscanf(arq,"%c %d %f", &c, &x, &y);
	fseek (arq, p, SEEK_SET);
	c1 = getc(arq);
	putc(c1, arq2);
	fprintf(arq," %d %f\n", x, y);	  
	
	fclose(arq);
	fclose(arq2);			
}
